﻿using System;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer.stmt.db2
{
	// Token: 0x020001D5 RID: 469
	public class TDb2DeclareCursorStatement : TCustomDb2Stmt
	{
		// Token: 0x06000FC3 RID: 4035 RVA: 0x0030C31F File Offset: 0x0030A51F
		public TDb2DeclareCursorStatement(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.sstdb2declarecursorstatement;
		}

		// Token: 0x06000FC4 RID: 4036 RVA: 0x0030C333 File Offset: 0x0030A533
		internal override void buildsql()
		{
		}

		// Token: 0x06000FC5 RID: 4037 RVA: 0x0030C335 File Offset: 0x0030A535
		internal override void clear()
		{
		}

		// Token: 0x06000FC6 RID: 4038 RVA: 0x0030C337 File Offset: 0x0030A537
		internal override string getasprettytext()
		{
			return "";
		}

		// Token: 0x06000FC7 RID: 4039 RVA: 0x0030C33E File Offset: 0x0030A53E
		internal override void iterate(TVisitorAbs pvisitor)
		{
		}

		// Token: 0x06000FC8 RID: 4040 RVA: 0x0030C340 File Offset: 0x0030A540
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			TDeclareSqlNode tdeclareSqlNode = (TDeclareSqlNode)this.rootNode;
			base.doParseStatement(psql);
			this.cursorName = tdeclareSqlNode.CursorName;
			this.subquery = new TSelectSqlStatement(this.dbvendor);
			this.subquery.rootNode = tdeclareSqlNode.SelectSqlNode;
			this.subquery.doParseStatement(this);
			return 0;
		}

		// Token: 0x06000FC9 RID: 4041 RVA: 0x0030C3A7 File Offset: 0x0030A5A7
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000FCA RID: 4042 RVA: 0x0030C3B7 File Offset: 0x0030A5B7
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			this.subquery.accept(v);
			v.postVisit(this);
		}

		// Token: 0x170002F2 RID: 754
		// (set) Token: 0x06000FCB RID: 4043 RVA: 0x0030C3D3 File Offset: 0x0030A5D3
		public virtual TObjectName CursorName
		{
			set
			{
				this.cursorName = value;
			}
		}

		// Token: 0x170002F3 RID: 755
		// (set) Token: 0x06000FCC RID: 4044 RVA: 0x0030C3DC File Offset: 0x0030A5DC
		public virtual TSelectSqlStatement Subquery
		{
			set
			{
				this.subquery = value;
			}
		}

		// Token: 0x04001381 RID: 4993
		private TObjectName cursorName;

		// Token: 0x04001382 RID: 4994
		private TSelectSqlStatement subquery;
	}
}
